<div class="ui-g">
    <div class="ui-g-2 border-spe-right">
        <p-tree [value]="procTree" selectionMode="single" [filter]="true" filterMode="strict" 
            [(selection)]="selectedNode" emptyMessage="无数据" (onNodeSelect)="nodeSelect()"
            [style]="{'padding':'0','height': 'calc(100% - 75px)','width':'100%','border-style':'none'}">
        </p-tree>
    </div>
    <div class="ui-g-10">
        <div class="button-item">
            <button pButton type="text" class="ui-button-success" icon="fa fa-check" (click)="saveUpdate()"
                label="保存"></button>
        </div>
        <div class="container">
            <p-table #dt [columns]="cols" [value]="parts" [(selection)]="checkedParts" [scrollable]="true"
                [scrollHeight]="scrollHeight">
                <ng-template pTemplate="header" let-columns>
                    <tr>
                        <th style="width: 3em"></th>
                        <th *ngFor="let col of columns" [ngStyle]="col.style">
                            {{col.header}}
                        </th>
                    </tr>
                    <tr>
                        <th style="width: 3em">
                            <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                        </th>
                        <th *ngFor="let col of columns" [ngSwitch]="col.field">
                            <input *ngSwitchCase="'partId'" pInputText type="text" style="width:100%;"
                                (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                            <input *ngSwitchCase="'partName'" pInputText type="text" style="width:100%;"
                                (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                            <input *ngSwitchCase="'partType'" pInputText type="text" style="width:100%;"
                                (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                            <input *ngSwitchCase="'unitName'" pInputText type="text" style="width:100%;"
                                (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                        </th>
                    </tr>
                </ng-template>
                <ng-template pTemplate="body" let-rowData let-columns="columns">
                    <tr [pSelectableRow]="rowData">
                        <td style="width: 3em;text-align: center">
                            <p-tableCheckbox [value]="rowData"></p-tableCheckbox>
                        </td>
                        <td *ngFor="let col of columns" [ngStyle]="col.style">
                            {{rowData[col.field]}}
                        </td>
                    </tr>
                </ng-template>
            </p-table>
        </div>
    </div>
</div>